package com.micromall.common.payment;

/**
 * Created by Dante Fung on 2017/6/21.
 */
public class ISPaymentResponse {

    public enum  OrderStatus{
        /**交易成功**/
        SUCCESS("Y","交易成功！"),
        /***交易失败*/
        FAIL("N","交易失败！"),
        /**交易处理中**/
        DEALING("P", "处理中！");

        private String code;
        private String desc;
        OrderStatus(String code, String desc){
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDescByCode(String code){
            String return_value = "";
            for(OrderStatus statusEnum : OrderStatus.values()){
                if (statusEnum.getCode().equalsIgnoreCase(code) ) {
                    return_value = statusEnum.getDesc();
                }
            }
            return return_value;
        }
    }

    public enum RetEncodeType{
        // 16#Md5WithRsa 数字签名方式
        Md5WithRsa("16","RSA数字签名方式"),
        //17#Md5 数字签名方式
        Md5("17","Md5 数字签名方式");

        private String code;
        private String desc;
        RetEncodeType(String code, String desc){
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

}
